//
//  YBNormalTreeModel.m
//  GongXinDangJian
//
//  Created by apple on 17/12/12.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "YBNormalTreeModel.h"

@implementation YBNormalTreeModel
- (id)initWithName:(NSString *)name children:(NSArray *)children
{
    self = [super init];
    if (self) {
        self.children = [children mutableCopy];
        self.name = name;
    }
    return self;
}
+ (id)dataObjectWithName:(NSString *)name children:(NSArray *)children
{
    return [[self alloc] initWithName:name children:children];
}


+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"children" : [YBNormalTreeModel class]};
}


-(CGFloat)titleHeight
{
    CGFloat tempHeight = [self.name boundingRectWithSize:CGSizeMake([UIScreen zj_screenWith] - ItemWidth * 280, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : LYPFONT(16)} context:nil].size.height + 1;
    if (tempHeight < ItemHeight * 80) {
        tempHeight = ItemHeight * 80;
    }
    return tempHeight;
}


@end
